package wpwork.service;

import com.baomidou.mybatisplus.extension.service.IService;
import wpwork.base.service.SuperService;
import wpwork.entity.KshGroupEntity;
import wpwork.entity.KshMessageEntity;
import wpwork.model.MarkAsReadRequestDTO;
import wpwork.model.MessageResponseDTO2;
import wpwork.model.QueryMessageRequestDTO;
import wpwork.model.SendMessageRequestDTO;

import java.util.List;

public interface IKshMessageService extends IService<KshMessageEntity> , SuperService<KshMessageEntity> {

    /**
     * 发送消息
     * 个人消息：直接创建一条记录
     * 群组消息：为群组中每个用户创建一条个人记录，但类型标记为群组
     */
    boolean sendMessage(SendMessageRequestDTO request);

    /**
     * 批量标记消息为已读
     */
    boolean markMessagesAsRead(MarkAsReadRequestDTO request);

    /**
     * 查询个人或群组消息
     */
    List<KshMessageEntity> queryMessages(QueryMessageRequestDTO request);

    /**
     * 查询未读消息
     */
    List<KshMessageEntity> getUnreadMessages(String toUserId);

    /**
     * 根据群组ID获取群组成员列表
     */
    List<String> getGroupMembers(String groupId);

    List<MessageResponseDTO2> instantMessage(String receivePerson, String sendPerson, String sendType, String keyword, String startTime, String endTime);

}
